﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;

namespace HZ.Supervise.Web.Secondphase
{
    public partial class ReportOfSeason : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!Page.IsPostBack)
            {
                Databing();
               
            }
        }
        public void Databing()
        {
            //<asp:BoundField DataField="GoodsInfo" HeaderText="流水号" ReadOnly="true" />
            //    <asp:BoundField DataField="ProductName" HeaderText="通用名称" ReadOnly="true" />
            //    <asp:BoundField DataField="MedicineModelName" HeaderText="剂型" ReadOnly="true" />
            //    <asp:BoundField DataField="Outlookc" HeaderText="规格" ReadOnly="true" />
            //    <asp:BoundField DataField="Unit" HeaderText="单位" ReadOnly="true" />
            //    <asp:BoundField DataField="Factor" HeaderText="系数" ReadOnly="true" />
            //    <asp:BoundField DataField="ProcurePrice" HeaderText="采购限价" ReadOnly="true" />
            //    <asp:BoundField DataField="CompanyName_Sc" HeaderText="生产企业" ReadOnly="true" />
            //    <asp:BoundField DataField="PurchaseNumerbTotalc" HeaderText="采购总数量" ReadOnly="true" />
            //    <asp:BoundField DataField="PurchaseAmountTotal" HeaderText="采购总金额" ReadOnly="true" />
            //    <asp:BoundField DataField="LastMonthRanked" HeaderText="上月排名" ReadOnly="true" />
            //    <asp:BoundField DataField="RankedChange" HeaderText="名次变化" ReadOnly="true" />
            DataTable dt = new DataTable();
            DataColumn dc1 = new DataColumn("hospital", typeof(string)); dt.Columns.Add(dc1);
            //DataColumn dc2 = new DataColumn("PurchaseNumerbTotalc", typeof(string)); dt.Columns.Add(dc2);
            DataColumn dc2 = new DataColumn("PurchaseNumerbTotalc_jb", typeof(string)); dt.Columns.Add(dc2);
            DataColumn dc3 = new DataColumn("PurchaseNumerbTotalc_fjb", typeof(string)); dt.Columns.Add(dc3);
            // DataColumn dc5 = new DataColumn("PurchaseAmountTotal", typeof(string)); dt.Columns.Add(dc5);
            DataColumn dc4 = new DataColumn("PurchaseAmountTotal_jb", typeof(string)); dt.Columns.Add(dc4);
            DataColumn dc5 = new DataColumn("PurchaseAmountTotal_fjb", typeof(string)); dt.Columns.Add(dc5);
            //DataColumn dc8 = new DataColumn("LastMonthRanked", typeof(string)); dt.Columns.Add(dc8);
            // DataColumn dc9 = new DataColumn("RankedChange", typeof(string)); dt.Columns.Add(dc9);

            DataColumn dc6 = new DataColumn("PurchaseNumerbTotalc_jb1", typeof(string)); dt.Columns.Add(dc6);
            DataColumn dc7 = new DataColumn("PurchaseNumerbTotalc_fjb1", typeof(string)); dt.Columns.Add(dc7);
            // DataColumn dc5 = new DataColumn("PurchaseAmountTotal", typeof(string)); dt.Columns.Add(dc5);
            //DataColumn dc8 = new DataColumn("PurchaseAmountTotal_jb2", typeof(string)); dt.Columns.Add(dc8);
            //DataColumn dc9 = new DataColumn("PurchaseAmountTotal_fjb2", typeof(string)); dt.Columns.Add(dc9);
            for (int i = 0; i < 2; i++)
            {
                DataRow dr = dt.NewRow();
                dr[0] = "第"+i+"季度" + i.ToString();
                dr[1] = "1000";
                dr[2] = "300";
                dr[3] = "600";
                dr[4] = "90000.000";
                dr[5] = "20000.000";
                dr[6] = "70000.00";
                //dr[7] = "60000.00";
                //dr[8] = "40000.00";
                dt.Rows.Add(dr);
            }

            gvwProcureCatalog.DataSource = dt;
            gvwProcureCatalog.DataBind();
        }
        protected void gvwProcureCatalog_RowCreated(object sender, GridViewRowEventArgs e)
        {
            switch (e.Row.RowType)
            {
                case DataControlRowType.Header:

                    //取得下拉框的月份


                    //第一行表头
                    TableCellCollection tcHeader = e.Row.Cells;
                    tcHeader.Clear();
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[0].Attributes.Add("colspan", "1"); //跨Row
                    tcHeader[0].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[0].Attributes.Add("bgcolor", "white");
                    tcHeader[0].Text = "";
                    //tcHeader.Add(new TableHeaderCell());
                    //tcHeader[1].Attributes.Add("bgcolor", "Red");
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[1].Attributes.Add("colspan", "6"); //跨Column
                    tcHeader[1].Text = "季度统计";
                                      
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[2].Attributes.Add("colspan", "2"); //跨Column
                    tcHeader[2].Text = "</th></tr><tr>";



                    //第2行表头
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[3].Attributes.Add("bgcolor", "LightSteelBlue");
                    tcHeader[3].Text = "";
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[4].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[15].Attributes.Add("colspan", "2");
                    tcHeader[4].Text = "季度采购总金额";
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[5].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[16].Attributes.Add("colspan", "2");
                    tcHeader[5].Text = "季度配送总金额";

                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[6].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[17].Attributes.Add("colspan", "2");
                    tcHeader[6].Text = "季度采购药品总数量";
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[7].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[18].Attributes.Add("colspan", "2");
                    tcHeader[7].Text = "季度采购医院总数";

                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[8].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[19].Attributes.Add("colspan", "2");
                    tcHeader[8].Text = "季度参与配送企业总数";
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[9].Attributes.Add("bgcolor", "LightSteelBlue");
                    //tcHeader[20].Attributes.Add("colspan", "2");
                    tcHeader[9].Text = "季度参与生产企业总数";                  


                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[10].Attributes.Add("bgcolor", "Khaki");
                    tcHeader[10].Text = "操作";
                    tcHeader.Add(new TableHeaderCell());
                    tcHeader[11].Attributes.Add("bgcolor", "Khaki");
                    tcHeader[11].Text = "图表</th></tr><tr>";
                    break;
                
            }
        }
        protected void AspNetPager1_PageChanged(object sender, EventArgs e)
        {

        }

        protected void btnQuery_Click(object sender, EventArgs e)
        {
            AspNetPager1.CurrentPageIndex = 1;
            Databing();
        }

        protected void lbnSwitch_Click(object sender, EventArgs e)
        {

        }

        protected void btnExcel_Click(object sender, EventArgs e)
        {

        }

        protected void lbtnSee_Click(object sender, EventArgs e)
        {

        }      
    }
}
